<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="java.util.*" %>
<%@ page import="org.jbpm.graph.def.*" %>
<%@ page import="org.jbpm.graph.exe.*" %>
<%@ page import="org.jbpm.db.*" %>
<%@ page import="org.jbpm.*" %>
<%@ page import="com.gzgi.workflow.jbpm.model.*" %>
<%@ page import="com.gzgi.workflow.jbpm.datafield.*" %>
<%@ page import="com.gzgi.workflow.jbpm.context.*" %>
<%@ page import="com.gzgi.workflow.jbpm.container.*" %>
<%@ page import="com.gzgi.workflow.jbpm.service.*" %>
<%@ page import="com.gzgi.workflow.jbpm.util.*" %>
<%@ page import="org.apache.commons.lang.*" %>
<%@ page import="EDU.oswego.cs.dl.util.concurrent.Semaphore" %>
<%@ include file="/pages/system/checkAdmin.jsp"%>
<%
        com.gzgi.framework.util.RequestUtil.setRequestParameterToAttribute(request);
        String processInstanceId = request.getParameter("processInstanceId");
        String taskName = request.getParameter("taskName");
		String actorIdXY = request.getParameter("actorIdXY");
		try {
			  if(processInstanceId != null && taskName != null && actorIdXY != null){
				  Set actorIds = new HashSet();
				  StringTokenizer token = new StringTokenizer(actorIdXY, ",");
				  while (token.hasMoreTokens()) {
					  String str = token.nextToken();
					  actorIds.add(str);
				  }
				  System.out.println("actorIds:"+actorIds);
                  ProcessContainer.getContainer().reassignTask(processInstanceId, taskName, actorIds);
			  }
		}catch (Exception ex) {
			ex.printStackTrace();
			throw new org.jbpm.JbpmException(ex);
		}
%>
<%@ include file="/pages/tm/header.jsp"%>
<script language="JavaScript">
    function submitForm(){
		document.iForm.bt01.disabled=true;
        document.iForm.submit();
     }
</script>
<center>
<br><br>
<form name="iForm" method="post" action="" class="x-form">
<div style="width:80%;" align="center">
        <div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>
        <div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc">
            <h3 style="margin-bottom:5px;">
			<img src="<%=request.getContextPath()%>/pages/images/window.png" alt="重新分派任务">&nbsp;重新分派任务</h3>
            
            <div class="x-form-bd" id="container">

                <fieldset>
                    <legend>重新分派任务</legend>
					<table align="center" width="90%" border="0" cellspacing="1" cellpadding="0" class="list-box">
					<tr class="list-title">
						<td align="left" width="150">流程实例编号</td>
						<td align="left">
						<input type="text" id="processInstanceId" name="processInstanceId" size="50"  value="" class="x-form-text">
						</td>
					   </tr>
					   <tr class="list-title">
					   <td align="left" width="150">任务名称</td>
						<td align="left">
						<input type="text" id="taskName" name="taskName"  size="50"  value="" class="x-form-text">
						</td>
						</tr>
					   <tr class="list-title">
						<td align="left" width="150">参与者</td>
						<td align="left">
						<input type="text" id="actorIdXY" name="actorIdXY" size="50"  value="" class="x-form-text">（多个参与者之间用,隔开）
						</td>
						</tr>
					  </table>
				</fieldset>

            </div>

			 <div align="center">
				     <br/>
					     <input type="button" name="bt01" value=" 确 定 " onclick="submitForm();" class="button">
					 <br/><br/>
		   </div>

        </div></div></div>
        <div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>
    </div>
</form>
</center>
